package com.cs171.market.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.*;

/**
 * @author yangyifei+liuyijie
 * @version 1.0
 * @date 2020/6/20 23:24
 */
@Entity
@Table(name = "sp_order")
public class Order {
    /**
     * 商品id，自增
     */
    @Id
    @GeneratedValue //自增注解
    // TODO:
    @JSONField(name="orderID")
    //@JSONField(name = "order_id")
    private Integer oid;
    /**
     * 用户id，外链
     */
    @JSONField(name = "user_id")
    private Integer uid;
    /**
     * 订单名称
     */
    @JSONField(name = "order_number")
    private String oname;
    /**
     * 订单价格
     */
    @JSONField(name = "payments")
    private Integer oprice;
    /**
     * 已付款
     */
    @JSONField(name = "pay_status")
    private Integer opay;
    /**
     * 已发货
     */
    @JSONField(name="state")
    //@JSONField(name = "is_send")
    private String osend;
    /**
     * 创建时间
     */
    //@JSONField(name="orderTime")
    @JSONField(name = "create_time")
    private Long otime;
    /**
     * 包装价
     */
    @JSONField(name = "packPrice")
    private String packprice;
    /**
     * 运费
     */
    @JSONField(name = "deliverPrice")
    private String deliveryprice;
    /**
     * 下单者联系电话
     */
    @JSONField(name = "orderPhone")
    private String ophone;
    /**
     * 订单地址
     */
    @JSONField(name = "ordererAddress")
    private String oaddr;
    /**
     * 投递员姓名
     */
    @JSONField(name = "deliverStaff")
    private String staffname;
    /**
     * 投递员电话
     */
    @JSONField(name = "staffPhone")
    private String staffphone;

    public Order() {
    }


    public Order(Integer uid, String oname, Integer oprice, Integer opay, String osend, Long otime, String packprice, String deliveryprice, String ophone, String oaddr) {
        this.uid = uid;
        this.oname = oname;
        this.oprice = oprice;
        this.opay = opay;
        this.osend = osend;
        this.otime = otime;
        this.packprice = packprice;
        this.deliveryprice = deliveryprice;
        this.ophone = ophone;
        this.oaddr = oaddr;
    }

    public Order(Integer uid, String oname, Integer oprice, Integer opay, String osend, Long otime) {
        this.uid = uid;
        this.oname = oname;
        this.oprice = oprice;
        this.opay = opay;
        this.osend = osend;
        this.otime = otime;
    }

    public Order(Integer uid, String oname, Integer oprice, Integer opay, String osend, Long otime, String packprice, String deliveryprice, String ophone, String oaddr, String staffname, String staffphone) {
        this.uid = uid;
        this.oname = oname;
        this.oprice = oprice;
        this.opay = opay;
        this.osend = osend;
        this.otime = otime;
        this.packprice = packprice;
        this.deliveryprice = deliveryprice;
        this.ophone = ophone;
        this.oaddr = oaddr;
        this.staffname = staffname;
        this.staffphone = staffphone;
    }

    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getOname() {
        return oname;
    }

    public void setOname(String oname) {
        this.oname = oname;
    }

    public Integer getOprice() {
        return oprice;
    }

    public void setOprice(Integer oprice) {
        this.oprice = oprice;
    }

    public Integer getOpay() {
        return opay;
    }

    public void setOpay(Integer opay) {
        this.opay = opay;
    }

    public String getOsend() {
        return osend;
    }

    public void setOsend(String osend) {
        this.osend = osend;
    }

    public Long getOtime() {
        return otime;
    }

    public void setOtime(Long otime) {
        this.otime = otime;
    }

    public String getOphone() {
        return ophone;
    }

    public void setOphone(String ophone) {
        this.ophone = ophone;
    }

    public String getOaddr() {
        return oaddr;
    }

    public void setOaddr(String oaddr) {
        this.oaddr = oaddr;
    }

    public String getPackprice() {
        return packprice;
    }

    public void setPackprice(String packprice) {
        this.packprice = packprice;
    }

    public String getDeliveryprice() {
        return deliveryprice;
    }

    public void setDeliveryprice(String deliveryprice) {
        this.deliveryprice = deliveryprice;
    }

    public String getStaffname() {
        return staffname;
    }

    public void setStaffname(String staffname) {
        this.staffname = staffname;
    }

    public String getStaffphone() {
        return staffphone;
    }

    public void setStaffphone(String staffphone) {
        this.staffphone = staffphone;
    }
}
